package com.alipay.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig1 {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2021000118651087";

	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC08X/oPMDrQzQZ0MNiTU4eUtu7W7b9+QKXlcrxC7k+Ykuyg4kuMao4mzZnkuhPic8rKEFA8YaOlvxwL9iYUTO7boYX/3EbprVY6WMw2nzdMzcP/DkMHklYwAlJtYch052UhFugmjJl1TxjEKHH6b6CNHk/dIk4in9FAUlzHUfI5S9Yz4gqIkd/pI7LA1BfcDBpUctowOWdsbQ9Z4f1+ylBXz/g0TMiKRkpRSkVe7jzTAhi1Vuvejea+ogEu0pHyYaWRg01tTsb3GmUJkzVHnArF4hq2lkQV3Ngs8IFb/6q+kkHCZLG640tdmkP7D50VeSzPiyKK50F3sWddNhv1AejAgMBAAECggEBALCZtFkaUsBLyyIXG1tqUABQpp1qmmOvEdSZIoW5B4fXsEH/F3i6iITPGH5mZ86ZllVs6KNWGBo7Sw7D5AZl2rPo33+0lNSEFSM+Rs17sbrDLc6wQY2OUdAJPgdu4QEm5Pn7ZOKPHPk+8b1Oklfnz0SNqnlAaF2C70yOQP3VaiarwMTizOTtrZ1oFrOPElUpynXW7FUMKl37aKD88gDcpd/Q4MB+8ptrCJIxQGUWaCzw1OmwKmbphths56fJOvwFQUXoWqUIzISwOBmUSGH6RN6pII46xKxjakwjZRr1X/NUcMMcwTfRSABc0yxfO0BaQHR8VR4sJLBS3cstkUTCGoECgYEA+OPrxm8cbv8Kl+WqMe1g41sYVssATIrTocme4EsEuGzkVSHDPrU88fWc8CQBgSvRXgnf3mB0JOXKLc97iwRXIsR5DGpJgMhH6nTs3gm4OemHZvDI6uYeJxQwuPGX0PKqwLN56+Q22vxDPoqfpjwaFeJiSU+PrijHl5xuhJbjWbECgYEAuhyyok5T0L3cbvLmkSIUCoolBPQaWMXfgJ/qEd1EsqQjUDznCl1GbY5z8VNce+6iFpME8BS4HkIqSN4TkTNXP93ddUldqmxwaLvzcxeHCPaBOsHzg45sgAaYAJVU1D4pEAEoHs6GRUrXzffFHKXXXTiUADH5p4J3IROZBClKt5MCgYAD44vLjfDjyxhfRzdhkFPzOXkn4gQfLgwgewYAeyuXthvbOKvUTwCkxzGsjuN3ITgkQAM/dkJaUTzXemZzxZ2W7Xr2trJvULHO+AS7c2ttfDihYyHAidfuxGH+gcfde+0vFZ7SEL7KrSZf08qqzkWaEe93NccI8ZosxET1zWXAAQKBgFZV7cBBWbxh9xo48CCvkGB7SUUNABPiZxZCGNGEtdOxNPiJ6Bv0vTEhfkObCjIrt2GFfirpUagnxXncG3OmP3lPMOaxzBO9DkBnwD3J0kikIbriMlb7APY7GNRcceerllzoTHZOFBec6pOPtw7dGBUUpAObK1c7vIvJjZhSl2ilAoGAYUC1QOeFKoN40YUlqljAlPBX9jvNO40KjNW3NuVzvB3b95HRjCK7YJZov5gcTA6dmLiNl8vJnxc3ZcfLN3d0pNycjtfKejpunsv9bl4g1b24s7OzAARn884cjShr6Lw2HaSUeOIPXv6dpAR8RugSvLb9D+iiIIeXCIzN/OVDnmE=";

	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm8sSoImzZeRcSgVDWXhLw8JlBS/LZiiSMqex+FBSzH7Ig1P3IPWzZ+UFCzsibi4tmxghCehsv0KXkaCO1ZkQRZVl/q6D6PM4ttfXRSVuea9ig+PVPWvFdLyPZL0HFt9mU3T3M78Kt/NEn4ggnPVu9LhJfz1UBp0F1cFFgojeWFP96xGY5hTKTyrja1bytB391Bv23LohE76+2Q+9osa84SY0Rhf1qR3CAl+vEAG3D2mfM2cxl5NW3WytUldbhvpSewBUT96q0vXzJLGjlgO3C8Kf5jkphAwM8z2QzS4qkRq4CJgqIbvPie7p5zwCOcy6VmOb49bM54yiq2VWTttfcQIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://192.168.0.39:8080/alipay/notify_url.jsp";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://192.168.0.39:8080/alipay/return_url.jsp";

	// 签名方式
	public static String sign_type = "RSA2";

	// 字符编码格式
	public static String charset = "utf-8";

	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

	// 支付宝网关
	public static String log_path = "D:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

